CREATE TABLE [dbo].[TMFACT_CAMB]
(
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[CO_MONE_BASE] [dbo].[TD_VC_003] NOT NULL,
[TI_FACT_BASE] [dbo].[TD_VC_001_SINO] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMFACT_CA__CO_US__03F0984C] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMFACT_CA__FE_US__04E4BC85] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMFACT_CA__CO_US__05D8E0BE] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMFACT_CA__FE_US__06CD04F7] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMFACT_CAMB] WITH NOCHECK ADD CONSTRAINT [CK__TMFACT_CA__TI_FA__02FC7413] CHECK NOT FOR REPLICATION (([TI_FACT_BASE]='N' OR [TI_FACT_BASE]='S'))
GO
ALTER TABLE [dbo].[TMFACT_CAMB] ADD CONSTRAINT [PK__TMFACT_C__C03C05EC08D548FA] PRIMARY KEY CLUSTERED  ([CO_MONE], [CO_MONE_BASE]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMFACT_CAMB] ADD CONSTRAINT [FK__TMFACT_CA__CO_MO__3C1FE2D6] FOREIGN KEY ([CO_MONE]) REFERENCES [dbo].[TTMONE] ([CO_MONE])
GO
ALTER TABLE [dbo].[TMFACT_CAMB] ADD CONSTRAINT [FK__TMFACT_CA__CO_MO__3D14070F] FOREIGN KEY ([CO_MONE_BASE]) REFERENCES [dbo].[TTMONE] ([CO_MONE])
GO
GRANT SELECT ON  [dbo].[TMFACT_CAMB] TO [public]
GRANT INSERT ON  [dbo].[TMFACT_CAMB] TO [public]
GRANT DELETE ON  [dbo].[TMFACT_CAMB] TO [public]
GRANT UPDATE ON  [dbo].[TMFACT_CAMB] TO [public]
GO
